package com.tql.mall.common.constant;


/**
 * @Author: tyk
 * @Date: 2023/5/20 22:11
 * @Description: Redis常量类
 */
public class RedisConstant {


    // 数据过期时间，单位：秒，下同
    public static final long DATA_TIMEOUT = 24 * 60 * 60;
    // 空值过期时间
    public static final long DATA_TEMP_TIMEOUT = 10 * 60;

    // 尝试获取锁的最大等待时间
    public static final long LOCK_WAIT = 1;
    // 锁过期时间
    public static final long LOCK_EXPIRE = 1;


    /**
     * 商品详情页
     */
    public static final String SPU_SALE_ATTR = "spu:saleAttr";
    public static final String SPU_POSTER = "spu:poster";
    public static final String SKU_INFO = "sku:info";
    public static final String SPU_VALUE_IDS_MAP = "spu:valueIdsMap";
    public static final String SKU_BASE_ATTR_INFO = "sku_baseAttrInfo";

    /**
     * 热点key
     */
    public static final String SKU_HOT_KEY = "sku:hotKey";


    // 布隆过滤器
    public static final String BLOOM_FILTER = "bloom:filter";

    // 用户登录token前缀
    public static final String USER_LOGIN_TOKEN_PREFIX = "token:login:";

    // 用户token过期时间（7天）
    public static final long USER_TOKEN_EXPIRE = 60 * 60 * 24 * 7;


    // 购物车前缀
    public static final String CART_PREFIX = "cart:";
    // 流水号前缀
    public static final String ORDER_TRADE_NO = "tradeNo:";
}
